import time
from selenium import webdriver

class DriverUtil(object):
    driver = None

    def get_driver(self):
        if self.driver is None:
            self.driver = webdriver.Chrome()
            self.driver.get('http://baidu.com')
            self.driver.maximize_window()
            self.driver.implicitly_wait(10)
        return self.driver

    def quit_driver(self):
        if self.driver:
            time.sleep(3)
            self.driver.quit()
            self.driver = None
if __name__ == '__main__':
    print('main')
